home *** CD-ROM | disk | FTP | other *** search
- /************************************************************
- *
- * Created: Sunday, December 7, 1992 8:56:00 PM
- * CNeoIndexIterator.h
- * C++ class definition for index iterator class
- *
- *
- * Copyright © Neologic Systems 1992-1994. All Rights Reserved.
- * All rights reserved
- *
- *
- * Within a class, references to permanent objects are kept
- * in a sorted list called an index. It is often necessary to
- * serial traverse a list of objects in an index. Iterators
- * make the process of traversing an index easier. They also
- * allow indices to be used as all other collection classes.
- *
- ***********************************************************/
- #pragma once /* Include this file only once */
- #ifndef __CNeoIndexIterator__
- #define __CNeoIndexIterator__ 1
-
- #include "NeoTypes.h"
- #include CNeoIteratorNativeH
-
- class CNeoDatabase;
-
- class CNeoIndexIterator : public CNeoIteratorNative {
- public:
- /** Instance Methods **/
- CNeoIndexIterator(CNeoDatabase *aDatabase, const NeoID aClassID, CNeoSelect *aKey = nil, const Boolean aDeeply = FALSE, const Boolean aForward = TRUE);
- virtual ~CNeoIndexIterator(void);
-
- /** Access Methods **/
- NeoID getBaseClass(void) const {return fClassID;}
- NeoID getCurrentClass(void) const {return fCurrentClassID;}
- CNeoDatabase * getDatabase(void) const {return fDatabase;}
- Boolean isDeeply(void) const {return fDeeply;}
-
- /** Object List Management Methods **/
- virtual CNeoPersist *
- currentObject(void);
- virtual void * doUntil(NeoTestFunc1 aFunc, void *aParam = nil);
- virtual Boolean leap(const long aDelta);
- virtual CNeoPersist *
- nextObject(void);
- virtual CNeoPersist *
- previousObject(void);
- virtual CNeoNode * removeCurrent(void);
- virtual void reset(void);
-
- Boolean fDeeply; // Do we include all subclasses as well?
- unsigned char fFiller; // for word alignment
- NeoID fClassID; // Identity of the base class.
- CNeoDatabase * fDatabase; // The database that the objects are in.
-
- protected:
- virtual Boolean advance(const short aDelta);
- virtual Boolean cross(const Boolean aForward = TRUE);
-
- NeoID fCurrentClassID; // May differ from fClassID if fDeeply
- NeoID fSysClassID; // Class id of leaf nodes
- };
- #endif
-